package dht.run;


public class DhtDriver {

	public static void main(String[] args) throws Exception {
		if (args.length != 2) {
			System.out
					.println("Usage: java -jar DhtDriver.jar sub_command config_file");
			System.out
					.println("sub_commands: DataServer/MetaServer/Client/FSInit");
			System.exit(-1);
		} else {
			if (args[0].toLowerCase().equals("dataserver")) {
				DataServer ds = new DataServer();
				ds.runDataServer(args[1]);
			} else if (args[0].toLowerCase().equals("metaserver")) {
				MetaServer ms = new MetaServer();
				ms.runMetaServer(args[1]);
			} else if (args[0].toLowerCase().equals("client")) {
				Client c = new Client();
				c.runClient(args[1]);
			} else if (args[0].toLowerCase().equals("fsinit")) {
				FSInit fs = new FSInit();
				fs.runFSInit(args[1]);
			} else {
				System.out
						.println("Usage: java -jar DhtDriver.jar sub_command config_file");
				System.out
						.println("sub_commands: DataServer/MetaServer/Client/FSInit");
				System.exit(-1);
			}
		}
	}

}
